/**
 * 朱氏家族类型定义
 */

export interface ZhuMember {
  id: string;
  name: string;
  title: string; // 谥号、封号
  avatar: string;
  generation: number; // 第几代
  gender: 'female' | 'male';
  birthDate: string;
  deathDate?: string;
  reignPeriod?: string; // 在位时期（皇帝专有）
  role: 'crown-prince' | 'emperor' | 'noble' | 'prince' | 'royal';
  kingdomId: string; // 所属藩国
  fiefdom?: string; // 封地
  hasSBT: boolean;
  sbtTokenId?: number;
  achievements: string[];
  parentId?: string;
  children?: string[];
}

export interface Kingdom {
  id: string;
  name: string;
  capital: string;
  location: { lat: number; lng: number };
  type: 'duchy' | 'imperial' | 'princedom';
  establishedYear: number;
  founder: string;
  currentRuler: string;
  treasury: number; // 国库金额
  population: number;
  status: 'abolished' | 'active' | 'upgraded';
  description: string;
}

export interface HistoricalEvent {
  id: string;
  title: string;
  date: string;
  type: 'ceremony' | 'cultural' | 'governance' | 'military' | 'political';
  importance: 'critical' | 'major' | 'normal';
  description: string;
  participants: string[]; // 成员ID列表
  location: string;
  onChainHash?: string;
}

export interface GovernanceProposal {
  id: string;
  title: string;
  description: string;
  proposer: string;
  proposerKingdom: string;
  createTime: string;
  voteEndTime: string;
  type: 'ceremony' | 'finance' | 'law' | 'military';
  status: 'executed' | 'passed' | 'rejected' | 'voting';
  votesFor: number;
  votesAgainst: number;
  votesRequired: number;
  voters: VoteRecord[];
}

export interface VoteRecord {
  memberId: string;
  memberName: string;
  memberKingdom: string;
  vote: 'abstain' | 'against' | 'for';
  weight: number;
  voteTime: string;
}

export interface TreasuryTransaction {
  id: string;
  fromKingdom: string;
  toKingdom: string;
  amount: number;
  type: 'grant' | 'military' | 'trade' | 'tribute';
  description: string;
  createTime: string;
  status: 'confirmed' | 'executed' | 'pending';
  signatures: string[];
  requiredSignatures: number;
}
